// Created from GenerationTemplate
// For Decisions HL7 Engine
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.Reflection;
using DecisionsFramework.Design.Properties;
using Decisions.HL7.Generated.AbstractMessage;
using Decisions.HL7.DataTypes;
using ST = System.String;
using SI = System.String;
using TX = System.String;
using FT = System.String;
using IS = System.String;
using ID = System.String;
using SNM = System.String;

namespace Decisions.HL7.Message
{
    [DataContract]
	public class NDL : AbstractDataType
    {

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("1 Name",1)]
  	    [HL7Field(HL7Version.v231, 1, HL7Repeat.False, HL7Required.True,"CN")]
  	    [HL7Field(HL7Version.v24, 1, HL7Repeat.False, HL7Required.True,"CNN")]
  	    [HL7Field(HL7Version.v25, 1, HL7Repeat.False, HL7Required.True,"CNN")]
  	    [HL7Field(HL7Version.v251, 1, HL7Repeat.False, HL7Required.True,"CNN")]
  	    [HL7Field(HL7Version.v26, 1, HL7Repeat.False, HL7Required.True,"CNN")]
  	    [HL7Field(HL7Version.v27, 1, HL7Repeat.False, HL7Required.True,"CNN")]
	    public CNN Name {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("2 Start Date/time",2)]
  	    [HL7Field(HL7Version.v231, 2, HL7Repeat.False, HL7Required.True,"TS")]
  	    [HL7Field(HL7Version.v24, 2, HL7Repeat.False, HL7Required.True,"TS")]
  	    [HL7Field(HL7Version.v25, 2, HL7Repeat.False, HL7Required.True,"TS")]
  	    [HL7Field(HL7Version.v251, 2, HL7Repeat.False, HL7Required.True,"TS")]
  	    [HL7Field(HL7Version.v26, 2, HL7Repeat.False, HL7Required.True,"DTM")]
  	    [HL7Field(HL7Version.v27, 2, HL7Repeat.False, HL7Required.True,"DTM")]
	    public DTM StartDatetime {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("3 End Date/time",3)]
  	    [HL7Field(HL7Version.v231, 3, HL7Repeat.False, HL7Required.True,"TS")]
  	    [HL7Field(HL7Version.v24, 3, HL7Repeat.False, HL7Required.True,"TS")]
  	    [HL7Field(HL7Version.v25, 3, HL7Repeat.False, HL7Required.True,"TS")]
  	    [HL7Field(HL7Version.v251, 3, HL7Repeat.False, HL7Required.True,"TS")]
  	    [HL7Field(HL7Version.v26, 3, HL7Repeat.False, HL7Required.True,"DTM")]
  	    [HL7Field(HL7Version.v27, 3, HL7Repeat.False, HL7Required.True,"DTM")]
	    public DTM EndDatetime {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("4 Point of Care",4)]
  	    [HL7Field(HL7Version.v231, 4, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v24, 4, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v25, 4, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v251, 4, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v26, 4, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v27, 4, HL7Repeat.False, HL7Required.True,"IS")]
		[PointofCare]
	    public IS PointofCare {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("5 Room",5)]
  	    [HL7Field(HL7Version.v231, 5, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v24, 5, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v25, 5, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v251, 5, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v26, 5, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v27, 5, HL7Repeat.False, HL7Required.True,"IS")]
		[Room]
	    public IS Room {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("6 Bed",6)]
  	    [HL7Field(HL7Version.v231, 6, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v24, 6, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v25, 6, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v251, 6, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v26, 6, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v27, 6, HL7Repeat.False, HL7Required.True,"IS")]
		[Bed]
	    public IS Bed {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("7 Facility",7)]
  	    [HL7Field(HL7Version.v231, 7, HL7Repeat.False, HL7Required.True,"HD")]
  	    [HL7Field(HL7Version.v24, 7, HL7Repeat.False, HL7Required.True,"HD")]
  	    [HL7Field(HL7Version.v25, 7, HL7Repeat.False, HL7Required.True,"HD")]
  	    [HL7Field(HL7Version.v251, 7, HL7Repeat.False, HL7Required.True,"HD")]
  	    [HL7Field(HL7Version.v26, 7, HL7Repeat.False, HL7Required.True,"HD")]
  	    [HL7Field(HL7Version.v27, 7, HL7Repeat.False, HL7Required.True,"HD")]
	    public HD Facility {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("8 Location Status",8)]
  	    [HL7Field(HL7Version.v231, 8, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v24, 8, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v25, 8, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v251, 8, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v26, 8, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v27, 8, HL7Repeat.False, HL7Required.True,"IS")]
		[LocationStatus]
	    public IS LocationStatus {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("9 Patient Location Type",9)]
  	    [HL7Field(HL7Version.v231, 9, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v24, 9, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v25, 9, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v251, 9, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v26, 9, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v27, 9, HL7Repeat.False, HL7Required.True,"IS")]
		[PersonLocationType]
	    public IS PatientLocationType {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("10 Building",10)]
  	    [HL7Field(HL7Version.v231, 10, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v24, 10, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v25, 10, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v251, 10, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v26, 10, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v27, 10, HL7Repeat.False, HL7Required.True,"IS")]
		[Building]
	    public IS Building {get;set;}

        /// -----------------------------
        /// -----------------------------
		[DataMember]
    	[PropertyClassification("11 Floor",11)]
  	    [HL7Field(HL7Version.v231, 11, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v24, 11, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v25, 11, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v251, 11, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v26, 11, HL7Repeat.False, HL7Required.True,"IS")]
  	    [HL7Field(HL7Version.v27, 11, HL7Repeat.False, HL7Required.True,"IS")]
		[Floor]
	    public IS Floor {get;set;}





		public override string GetER7(HL7ParserOptions options) {
			List<string> dataTypeParts = new List<string>();
			dataTypeParts.Add(GetER7TextForDataPart(Name, options));
			dataTypeParts.Add(GetER7TextForDataPart(StartDatetime, options));
			dataTypeParts.Add(GetER7TextForDataPart(EndDatetime, options));
		    dataTypeParts.Add(PointofCare);
		    dataTypeParts.Add(Room);
		    dataTypeParts.Add(Bed);
			dataTypeParts.Add(GetER7TextForDataPart(Facility, options));
		    dataTypeParts.Add(LocationStatus);
		    dataTypeParts.Add(PatientLocationType);
		    dataTypeParts.Add(Building);
		    dataTypeParts.Add(Floor);
			return CleanUpTrailingComponentSeps(string.Join("" + options.ComponentSep, dataTypeParts.ToArray()), options);
		}
    }
}

